﻿<%@ Page Title="Add New Experiment" Language="C#" MasterPageFile="~/MasterPage.master"
   AutoEventWireup="true" CodeFile="DesignExperiment.aspx.cs" Inherits="NewExperimentTempName" %>

<%@ Register Src="Authors.ascx" TagName="Authors" TagPrefix="nmr" %>
<%-- Custom made page for screwturn wiki --%>
<asp:Content ID="Content1" ContentPlaceHolderID="CphMaster" runat="Server">
   <h1 class="pagetitlesystem">
      <asp:Literal ID="lblTitle" runat="server" meta:resourcekey="lblTitleResource1"
         Text="Add New Experiment" />
   </h1>
   <asp:ScriptManager ID="ScriptManager1" runat="server">
   </asp:ScriptManager>
   <asp:Panel ID="Panel2" runat="server" Style="margin-left: 770px; padding-bottom: 10px;
      padding-left: 0px; width: 330px; position: absolute; left: 0px; top: 200px">
      <asp:UpdatePanel runat="server">
         <ContentTemplate>
            <nmr:Authors ID="AuthorsList" runat="server" />
            <asp:CustomValidator ID="CustomValidator2" runat="server" ControlToValidate="AuthorsList"
               Style="vertical-align: top" EnableClientScript="False" ErrorMessage="At lease one author must be added."
               OnServerValidate="ValidateAuthorsNumber" ValidateEmptyText="false" Display="Dynamic">
            </asp:CustomValidator>
         </ContentTemplate>
         <Triggers>
            <asp:AsyncPostBackTrigger ControlID="butSubmit" EventName="Command" />
         </Triggers>
      </asp:UpdatePanel>
   </asp:Panel>
   <asp:UpdatePanel ID="MainForm" runat="server" ChildrenAsTriggers="false"
      UpdateMode="Conditional">
      <ContentTemplate>
         <asp:Label ID="lblName" runat="server" Text="Name" Width="150px" Style="margin-bottom: 3px"></asp:Label>
         <asp:Panel runat="server">
            <asp:TextBox ID="tbName" runat="server" Columns="80" Width="550px" Font-Size="14px"
               CssClass="InputField">
            </asp:TextBox>
            <asp:RequiredFieldValidator ID="valReqFieldName" runat="server" ControlToValidate="tbName"
               Display="Dynamic" ErrorMessage="<br />Name Must Be Present." SetFocusOnError="True">
            </asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
               ControlToValidate="tbName" Display="Dynamic" ErrorMessage="<br />Name must contain only Letters and Spaces."
               ValidationExpression="[A-z0-9][.0-9A-z\s]+" SetFocusOnError="True">
            </asp:RegularExpressionValidator>
         </asp:Panel>
         <br />
         <asp:Label ID="lblDim" runat="server" Text="Dimentionality" Width="150px"
            Style="margin-bottom: 3px">
         </asp:Label>
         <asp:Panel runat="server">
            <asp:DropDownList ID="genDimentionality" runat="server" Font-Size="14px"
               Width="150px">
               <asp:ListItem Selected="True">Please select</asp:ListItem>
               <asp:ListItem>1D</asp:ListItem>
               <asp:ListItem>2D</asp:ListItem>
               <asp:ListItem>3D</asp:ListItem>
               <asp:ListItem>4D</asp:ListItem>
               <asp:ListItem>Not Applicable</asp:ListItem>
            </asp:DropDownList>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
               ErrorMessage="RequiredFieldValidator" ControlToValidate="genDimentionality"
               Text="<br />Dimentionality must be selected." InitialValue="Please select"></asp:RequiredFieldValidator>
         </asp:Panel>
         <br />
         <asp:Label ID="lblMemo" runat="server" Text="Short Description" Width="150px"
            Style="margin-bottom: 3px"></asp:Label>
         <asp:Panel runat="server">
            <asp:TextBox ID="tbMemo" CssClass="InputField" runat="server" MaxLength="2000"
               Rows="2" TextMode="MultiLine" Width="550px" Font-Size="14px">
            </asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
               Style="vertical-align: top" ErrorMessage="RequiredFieldValidator" ControlToValidate="tbMemo"
               Display="Dynamic" Text="<br />Short Description must be present."></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" Style="vertical-align: top"
               runat="server" ControlToValidate="tbMemo" Display="Dynamic" ErrorMessage="<br />Short Description Should Not Contain &lt;&gt; and ' Charachters."
               ValidationExpression="[A-z0-9\s\\/:.,-?!@#$;%^&amp;*()\\]*">
            </asp:RegularExpressionValidator>
         </asp:Panel>
         <br />
         <asp:Label ID="lblType" runat="server" Text="Type" Width="150px" Style="margin-bottom: 3px">
         </asp:Label>
         <asp:Panel runat="server">
            <asp:TextBox ID="tbType" runat="server" Columns="80" Width="550px" Font-Size="14px"
               CssClass="InputField">
            </asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
               Style="vertical-align: top" ErrorMessage="RequiredFieldValidator" ControlToValidate="tbType"
               Text="<br />Type must be specified." Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
               ErrorMessage="RegularExpressionValidator" ControlToValidate="tbType"
               ValidationExpression="^[\w\s\-()]*$" Text="<br />Experiment type must contain letters, numbers and '-' sign only."
               Display="Dynamic"></asp:RegularExpressionValidator>
         </asp:Panel>
         <br />
         <asp:Label ID="lblComponents" runat="server" Text="Components" Width="150px"
            Style="vertical-align: top"></asp:Label>
         <br />
         <asp:UpdatePanel ID="uppanComponents" UpdateMode="Conditional" runat="server">
            <ContentTemplate>
               <p style="margin-left: 150px">
                  <asp:Label runat="server" ID="lblPPComp" Text="Pulse Program" ForeColor="Black"
                     Width="250px"></asp:Label>
                  <asp:ImageButton ID="ibAddPP" runat="server" AlternateText="Add Pulse Program"
                     CssClass="AddButton" OnCommand="lbAdd_Command" CausesValidation="false"
                     CommandName="Add" CommandArgument="pp" />
                  <asp:CustomValidator ID="CustomValidator3" runat="server" ErrorMessage="CustomValidator"
                     OnServerValidate="ValidatePulseProgram" Display="Dynamic" Text="One pulse program must be present."
                     EnableClientScript="False"></asp:CustomValidator>
                  <br />
                  <asp:Label runat="server" ID="lblSelectedPulseProgram" Visible="false"
                     ForeColor="Black"></asp:Label>
               </p>
               <br />
               <p style="margin-left: 150px">
                  <asp:Label runat="server" ID="lblWSComp" Text="Wave Shapes" Width="250px"
                     ForeColor="Black"></asp:Label>
                  <asp:ImageButton ID="ibAddWS" runat="server" AlternateText="Add Wave Shape"
                     CssClass="AddButton" CommandArgument="ws" CommandName="Add" CausesValidation="false"
                     OnCommand="lbAdd_Command" />
                  <br />
                  <asp:Label runat="server" ID="lblSelectedWaveShapes" Visible="false" ForeColor="Black"></asp:Label>
                  <br />
               </p>
               <p style="margin-left: 150px">
                  <asp:Label ID="lblCPDComp" runat="server" ForeColor="Black" Width="250px"
                     Text="CPDs"></asp:Label>
                  <asp:ImageButton ID="ibAddCPD" AlternateText="Add CPD" runat="server" CssClass="AddButton"
                     CausesValidation="false" CommandArgument="cpd" CommandName="Add" OnCommand="lbAdd_Command" />
                  <br />
                  <asp:Label runat="server" ID="lblSelectedCPDs" Visible="false" ForeColor="Black"></asp:Label>
               </p>
               <br />
               <p style="margin-left: 150px">
                  <asp:Label ID="lblScrComp" runat="server" ForeColor="Black" Width="250px"
                     Text="Scripts"></asp:Label>
                  <asp:ImageButton runat="server" ID="ibAddScr" AlternateText="Add Script"
                     CausesValidation="false" CommandArgument="scr" CommandName="Add" OnCommand="lbAdd_Command"
                     CssClass="AddButton" />
                  <br />
                  <asp:Label runat="server" ID="lblSelectedScripts" Visible="false" ForeColor="Black"></asp:Label>
               </p>
               <asp:MultiView ID="mvSelectComponent" runat="server" Visible="false">
                  <asp:View ID="vSelectPulseProgram" runat="server">
                     <asp:Panel ID="Panel1" runat="server" CssClass="DynamicTable">
                        <asp:HyperLink runat="server" Text="Add New (in new window)" CssClass="minorlink"
                           Style="margin-bottom: 5px" Target="_blank" NavigateUrl="~/AddComponent.aspx?CompType=pp" />
                        <asp:LinkButton runat="server" Text="Refresh" CssClass="minorlink" CausesValidation="false"
                           CommandName="RefreshPulsePrograms" OnCommand="RefreshTable" Style="margin-left: 10px;
                           margin-bottom: 5px" />
                        <asp:GridView ID="PulseProgramsTable" runat="server" AllowPaging="True"
                           AllowSorting="True" DataSourceID="PulseProgramSQLDataSource" AutoGenerateColumns="False"
                           PageSize="20" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None"
                           DataKeyNames="Id, Name" BorderWidth="1px" CellPadding="3" GridLines="Horizontal"
                           Width="100%" OnRowCommand="SelectComponent" EmptyDataText="There is no Pulse Programs to display">
                           <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                           <Columns>
                              <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" SortExpression="Id">
                                 <ItemStyle Width="50px" VerticalAlign="Top" />
                              </asp:BoundField>
                              <asp:ButtonField ButtonType="Link" CausesValidation="false" CommandName="SelectPulseProgram"
                                 DataTextField="Name" HeaderText="Name" SortExpression="Name">
                                 <ItemStyle Font-Underline="true" VerticalAlign="Top" Width="150px" />
                              </asp:ButtonField>
                              <asp:BoundField DataField="Date" HeaderText="Date" ReadOnly="True" SortExpression="Date"
                                 DataFormatString="{0:d}">
                                 <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="100px" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Short Description" HeaderText="Short Description"
                                 ReadOnly="True" SortExpression="Short Description">
                                 <ItemStyle Width="400px" VerticalAlign="Top" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Authors" HeaderText="Authors" ReadOnly="True"
                                 SortExpression="Authors">
                                 <ItemStyle Width="250px" Wrap="True" VerticalAlign="Top" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Name" HeaderText="Name" Visible="false" />
                           </Columns>
                           <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                           <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                           <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                           <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" HorizontalAlign="Left" />
                           <AlternatingRowStyle BackColor="#F7F7F7" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="PulseProgramSQLDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:NMRExperimentsConnectionString %>"
                           SelectCommand="SELECT id AS Id, name AS Name, date AS Date, SUBSTRING(memo, 1, 1000) AS [Short Description], dbo.PPConcatAuthNames(id) AS Authors FROM pulseprograms AS p">
                        </asp:SqlDataSource>
                     </asp:Panel>
                  </asp:View>
                  <asp:View ID="vSelectWaveShape" runat="server">
                     <asp:Panel runat="server" CssClass="DynamicTable">
                        <asp:HyperLink runat="server" Text="Add New (in new window)" CssClass="minorlink"
                           Style="margin-bottom: 5px" Target="_blank" NavigateUrl="~/AddComponent.aspx?CompType=ws" />
                        <asp:LinkButton runat="server" Text="Refresh" CssClass="minorlink" CausesValidation="false"
                           CommandName="RefreshWaveShapes" OnCommand="RefreshTable" Style="margin-left: 10px;
                           margin-bottom: 5px" />
                        <asp:GridView ID="WaveShapesTable" runat="server" AllowPaging="True" AllowSorting="True"
                           AutoGenerateColumns="False" BackColor="White" BorderColor="#E7E7FF"
                           BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="Id, Name"
                           DataSourceID="WaveShapesSQLDataSource" EmptyDataText="There is no Wave Shapes to display"
                           GridLines="Horizontal" OnRowCommand="SelectComponent" Width="100%">
                           <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                           <Columns>
                              <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" SortExpression="Id">
                                 <ItemStyle VerticalAlign="Top" Width="50px" />
                              </asp:BoundField>
                              <asp:ButtonField ButtonType="Link" CausesValidation="false" CommandName="SelectWaveShape"
                                 DataTextField="Name" HeaderText="Name" SortExpression="Name">
                                 <ItemStyle Font-Underline="true" VerticalAlign="Top" Width="150px" />
                              </asp:ButtonField>
                              <asp:BoundField DataField="Date" DataFormatString="{0:d}" HeaderText="Date"
                                 ReadOnly="True" SortExpression="Date">
                                 <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="100px" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Short Description" HeaderText="Short Description"
                                 ReadOnly="True" SortExpression="Short Description">
                                 <ItemStyle VerticalAlign="Top" Width="400px" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Authors" HeaderText="Authors" ReadOnly="True"
                                 SortExpression="Authors">
                                 <ItemStyle VerticalAlign="Top" Width="250px" Wrap="True" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Name" HeaderText="Name" Visible="false" />
                           </Columns>
                           <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                           <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                           <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                           <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" HorizontalAlign="Left" />
                           <AlternatingRowStyle BackColor="#F7F7F7" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="WaveShapesSQLDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:NMRExperimentsConnectionString %>"
                           SelectCommand="SELECT id AS Id, name AS Name, date AS Date, SUBSTRING(memo, 1, 1000) AS [Short Description], dbo.wsConcatAuthNames(id) AS Authors FROM waveshapes AS w">
                        </asp:SqlDataSource>
                     </asp:Panel>
                  </asp:View>
                  <asp:View ID="vSelectCPD" runat="server">
                     <asp:Panel runat="server" CssClass="DynamicTable">
                        <asp:HyperLink runat="server" Text="Add New (in new window)" CssClass="minorlink"
                           Style="margin-bottom: 5px" Target="_blank" NavigateUrl="~/AddComponent.aspx?CompType=cpd" />
                        <asp:LinkButton runat="server" Text="Refresh" CssClass="minorlink" CausesValidation="false"
                           CommandName="RefreshCPDs" OnCommand="RefreshTable" Style="margin-left: 10px;
                           margin-bottom: 5px" />
                        <asp:GridView ID="CPDsTable" runat="server" AllowPaging="True" AllowSorting="True"
                           AutoGenerateColumns="False" DataSourceID="CPDsSQLDataSource" BackColor="White"
                           BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3"
                           DataKeyNames="Id, Name" GridLines="Horizontal" Width="100%" EmptyDataText="There is no CPDs to display"
                           OnRowCommand="SelectComponent">
                           <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                           <Columns>
                              <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" SortExpression="Id">
                                 <ItemStyle Width="50px" VerticalAlign="Top" />
                              </asp:BoundField>
                              <asp:ButtonField ButtonType="Link" CausesValidation="false" CommandName="SelectCPD"
                                 DataTextField="Name" HeaderText="Name" SortExpression="Name">
                                 <ItemStyle Font-Underline="true" VerticalAlign="Top" Width="150px" />
                              </asp:ButtonField>
                              <asp:BoundField DataField="Date" HeaderText="Date" ReadOnly="True" SortExpression="Date"
                                 DataFormatString="{0:d}">
                                 <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="100px" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Short Description" HeaderText="Short Description"
                                 ReadOnly="True" SortExpression="Short Description">
                                 <ItemStyle Width="400px" VerticalAlign="Top" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Authors" HeaderText="Authors" ReadOnly="True"
                                 SortExpression="Authors">
                                 <ItemStyle Width="250px" Wrap="True" VerticalAlign="Top" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Name" HeaderText="Name" Visible="false" />
                           </Columns>
                           <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                           <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                           <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                           <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" HorizontalAlign="Left" />
                           <AlternatingRowStyle BackColor="#F7F7F7" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="CPDsSQLDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:NMRExperimentsConnectionString %>"
                           SelectCommand="SELECT id AS Id, name AS Name, date AS Date, SUBSTRING(memo, 1, 1000) AS [Short Description], dbo.cpdConcatAuthNames(id) AS Authors FROM cpds AS p">
                        </asp:SqlDataSource>
                     </asp:Panel>
                  </asp:View>
                  <asp:View ID="vSelectScript" runat="server">
                     <asp:Panel runat="server" CssClass="DynamicTable">
                        <asp:HyperLink runat="server" Text="Add New (in new window)" CssClass="minorlink"
                           Style="margin-bottom: 5px" Target="_blank" NavigateUrl="~/AddComponent.aspx?CompType=scr" />
                        <asp:LinkButton runat="server" Text="Refresh" CssClass="minorlink" CausesValidation="false"
                           CommandName="RefreshScripts" OnCommand="RefreshTable" Style="margin-left: 10px;
                           margin-bottom: 5px" />
                        <asp:GridView ID="ScriptsTable" runat="server" AllowPaging="True" AllowSorting="True"
                           AutoGenerateColumns="False" DataSourceID="ScriptsSQLDataSource" BackColor="White"
                           DataKeyNames="Id, Name" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
                           CellPadding="3" OnRowCommand="SelectComponent" GridLines="Horizontal"
                           Width="100%" EmptyDataText="There is no Scripts to display">
                           <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                           <Columns>
                              <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" SortExpression="Id">
                                 <ItemStyle Width="50px" VerticalAlign="Top" />
                              </asp:BoundField>
                              <asp:ButtonField ButtonType="Link" CausesValidation="false" CommandName="SelectScript"
                                 DataTextField="Name" HeaderText="Name" SortExpression="Name">
                                 <ItemStyle Font-Underline="true" VerticalAlign="Top" Width="150px" />
                              </asp:ButtonField>
                              <asp:BoundField DataField="Date" HeaderText="Date" ReadOnly="True" SortExpression="Date"
                                 DataFormatString="{0:d}">
                                 <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="100px" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Short Description" HeaderText="Short Description"
                                 ReadOnly="True" SortExpression="Short Description">
                                 <ItemStyle Width="400px" VerticalAlign="Top" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Authors" HeaderText="Authors" ReadOnly="True"
                                 SortExpression="Authors">
                                 <ItemStyle Width="250px" Wrap="True" VerticalAlign="Top" />
                              </asp:BoundField>
                              <asp:BoundField DataField="Name" HeaderText="Name" Visible="false" />
                           </Columns>
                           <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                           <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                           <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                           <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" HorizontalAlign="Left" />
                           <AlternatingRowStyle BackColor="#F7F7F7" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="ScriptsSQLDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:NMRExperimentsConnectionString %>"
                           SelectCommand="SELECT id AS Id, name AS Name, type AS Type, date AS Date, SUBSTRING(memo, 1, 1000) AS [Short Description], dbo.scrConcatAuthNames(id) AS Authors FROM scripts AS p">
                        </asp:SqlDataSource>
                     </asp:Panel>
                  </asp:View>
                  <asp:View ID="Default" runat="server">
                     <asp:Label runat="server" Text="Пилите, Шура, пилите - они золотые!"></asp:Label>
                  </asp:View>
               </asp:MultiView>
            </ContentTemplate>
            <Triggers>
               <asp:AsyncPostBackTrigger ControlID="butClear" EventName="Click" />
               <asp:AsyncPostBackTrigger ControlID="butSubmit" EventName="Command" />
            </Triggers>
         </asp:UpdatePanel>
         <br />
         <asp:Label ID="lblContent" runat="server" Text="Content" Width="150px"
            Style="margin-bottom: 3px"></asp:Label>
         <asp:Panel runat="server">
            <asp:TextBox ID="tbContent" runat="server" MaxLength="50000" CssClass="InputField"
               Font-Size="14px" Rows="20" TextMode="MultiLine" Width="550px">
            </asp:TextBox>
            <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="tbContent"
               Style="vertical-align: top" EnableClientScript="False" ErrorMessage="<br />Scripts Are Not Allowed."
               OnServerValidate="ValidateForScripts" ValidateEmptyText="True" Display="Dynamic">
            </asp:CustomValidator>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
               Style="vertical-align: top" ControlToValidate="tbContent" Display="Dynamic"
               ErrorMessage="<br />Content must be present.">
            </asp:RequiredFieldValidator>
         </asp:Panel>
         <br />
      </ContentTemplate>
      <Triggers>
         <asp:AsyncPostBackTrigger ControlID="butClear" EventName="Click" />
      </Triggers>
   </asp:UpdatePanel>
   <asp:Button ID="butSubmit" runat="server" Text="Submit" OnCommand="butSubmit_Command"
      CausesValidation="true" />
   <asp:Button ID="butClear" runat="server" CausesValidation="False" OnClick="butClear_Click"
      Text="Clear" />
   <asp:UpdateProgress ID="UpdateProgress2" runat="server" DisplayAfter="300"
      AssociatedUpdatePanelID="MainForm">
      <ProgressTemplate>
         <div class="PleaseWait">
            Please Wait...</div>
      </ProgressTemplate>
   </asp:UpdateProgress>
</asp:Content>
